/**
 * 千位符
 * @param {*} num
 */
export function formatNum(num) {
  if((typeof num)=="number"){
    num = num.toFixed(2)
  }
  //转字符串保留两位小数
    if((typeof num)=="String"){
      num=parseFloat(num)
    }
  //千位符
  num = (num+'').replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g, '$1,')
  return num;
}
